package net.huashitong.ssydt.provider.exam.mapper;


import net.huashitong.ssydt.exam.entity.SsExamArticleRecord;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SsExamArticleRecordMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SsExamArticleRecord record);

    int insertSelective(SsExamArticleRecord record);

    SsExamArticleRecord selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SsExamArticleRecord record);

    int updateByPrimaryKey(SsExamArticleRecord record);

    SsExamArticleRecord getNotHistoryByUserIdAndArticleId(SsExamArticleRecord record);

    /**
     * 统计该文章测评已交卷数
     *
     * @param articleId
     * @return
     */
    int countSubmittedByArticleId(Long articleId);

    /**
     * 统计该文章测评小于等于correctNumber的已交卷数
     *
     * @param record
     * @return
     */
    int countSubmittedByArticleIdWithLessOrEqualsCorrectNumber(SsExamArticleRecord record);
}